<?php
class tacgia extends database{
	
	function __construct(){
		$this->connection();
	}
	protected $_ten_tg;
	protected $_hinh_tg;
	
	public function set_ten_tg ($i) { $this->_ten_tg = $i; } 
	public function get_ten_tg () { return $this->_ten_tg;	} 
	
	public function set_hinh_tg ($i) { $this->_hinh_tg = $i; } 
	public function get_hinh_tg () { return $this->_hinh_tg;	} 
	
	function get_auto_increment()
    {
        $sql = "SHOW TABLE STATUS WHERE name = 'tac_gia'";
        $this->query($sql);
        if ($this->num_rows() != 0) {
            $row = $this->fetch();
            return $row['Auto_increment'];
        } else {
            return FALSE;
        }
    }
	
	 public function insert_tacgia()
    {
        $sql = "INSERT INTO tac_gia(ten_tg, hinh_tg) VALUES('" . $this->get_ten_tg() . "', '" . $this->get_hinh_tg() . "')";
        $this->query($sql);
    }
}
?>